package t1;

import java.util.Scanner;

public class Client {

	public static void main(String[] args) {
		String n = "5";
		Scanner cin = new Scanner(System.in);
		Tools tool = new Tools();
		while (true) {
			if (n == "0") {
				break;
			}
			System.out.println("输入1添加学生");
			System.out.println("输入2按姓名查找学生");
			System.out.println("输入3按专业查找学生");
			System.out.println("输入4输出所有学生");
			System.out.println("输入0退出");
			n = cin.nextLine();
			System.out.println();
			if (n.equals("1")) {
				tool.add(cin);
			} else if (n.equals("2")) {
				System.out.println("请输入要查找的姓名");
				tool.outStudentByName(cin);
			} else if (n.equals("3")) {
				System.out.println("请输入要查找的专业");
				tool.outStudentByMajor(cin);
			} else if (n.equals("4")) {
				tool.outAllStudent();
			} else if (n.equals("0")) {
				tool.quite();
				System.out.println("已退出");
				break;
			}

		}
		cin.close();
	}

}
